package com.mioto.ld.module.log.service.impl;

import com.mioto.ld.module.log.dao.BizLogDao;
import com.mioto.ld.module.log.model.BizLog;
import com.mioto.ld.module.log.model.BizLogDTO;
import com.mioto.ld.module.log.service.IBizLogService;
import com.mioto.ld.utils.BaseUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

/**
 * @author mioto-qinxj
 * @date 2024/5/6
 * @desc
 */
@Service
public class BizLogServiceImpl implements IBizLogService {

    @Resource
    private BizLogDao bizLogDao;

    @Override
    public void insert(BizLog bizLog) {
        bizLog.setCreateDate(new Date());
        bizLog.setUserId(BaseUtil.getLoginUser().getId());
        bizLogDao.insert(bizLog);
    }

    @Override
    public List<BizLogDTO> findList() {
        return bizLogDao.findList();
    }
}
